   1              		.syntax unified
   2              		.cpu cortex-m3
   3              		.fpu softvfp
   4              		.eabi_attribute 20, 1
   5              		.eabi_attribute 21, 1
   6              		.eabi_attribute 23, 3
   7              		.eabi_attribute 24, 1
   8              		.eabi_attribute 25, 1
   9              		.eabi_attribute 26, 1
  10              		.eabi_attribute 30, 4
  11              		.eabi_attribute 34, 1
  12              		.eabi_attribute 18, 4
  13              		.thumb
  14              		.syntax unified
  15              		.file	"spi_ee25xx.c"
  16              		.text
  17              	.Ltext0:
  18              		.cfi_sections	.debug_frame
  19              		.section	.text.ee25xx_Init,"ax",%progbits
  20              		.align	1
  21              		.global	ee25xx_Init
  22              		.thumb
  23              		.thumb_func
  25              	ee25xx_Init:
  26              	.LFB0:
  27              		.file 1 "uc_libc_dev/midia/spi_ee25xx.c"
   1:uc_libc_dev/midia/spi_ee25xx.c **** /*
   2:uc_libc_dev/midia/spi_ee25xx.c **** 	Driver usado nas memórias eeprom modelos:
   3:uc_libc_dev/midia/spi_ee25xx.c **** 		25lc640
   4:uc_libc_dev/midia/spi_ee25xx.c **** */
   5:uc_libc_dev/midia/spi_ee25xx.c **** 
   6:uc_libc_dev/midia/spi_ee25xx.c **** #include "spi_ee25xx.h"
   7:uc_libc_dev/midia/spi_ee25xx.c **** 
   8:uc_libc_dev/midia/spi_ee25xx.c **** #if (SPI_EEPROM_USE_DEBUG == pdON)
   9:uc_libc_dev/midia/spi_ee25xx.c **** #include "stdio_uc.h"
  10:uc_libc_dev/midia/spi_ee25xx.c **** #endif
  11:uc_libc_dev/midia/spi_ee25xx.c **** 
  12:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  13:uc_libc_dev/midia/spi_ee25xx.c **** // Descrição: 	Configura o pino CHIP SELECT da eeprom
  14:uc_libc_dev/midia/spi_ee25xx.c **** // parametros	Nenhum
  15:uc_libc_dev/midia/spi_ee25xx.c **** // Retorna: 	Nada
  16:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  17:uc_libc_dev/midia/spi_ee25xx.c **** void ee25xx_Init(void) {	
  28              		.loc 1 17 0
  29              		.cfi_startproc
  30              		@ args = 0, pretend = 0, frame = 0
  31              		@ frame_needed = 0, uses_anonymous_args = 0
  32              		@ link register save eliminated.
  18:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_SetupPorts();									// Ajustar portas
  33              		.loc 1 18 0
  34 0000 044A     		ldr	r2, .L2
  35 0002 1368     		ldr	r3, [r2]
  36 0004 43F04003 		orr	r3, r3, #64
  37 0008 1360     		str	r3, [r2]
  19:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Disable();										// Desabilita cartão
  38              		.loc 1 19 0
  39 000a 034B     		ldr	r3, .L2+4
  40 000c 4022     		movs	r2, #64
  41 000e 1A60     		str	r2, [r3]
  42 0010 7047     		bx	lr
  43              	.L3:
  44 0012 00BF     		.align	2
  45              	.L2:
  46 0014 00C00920 		.word	537509888
  47 0018 18C00920 		.word	537509912
  48              		.cfi_endproc
  49              	.LFE0:
  51              		.section	.text.ee25xx_readStatus,"ax",%progbits
  52              		.align	1
  53              		.global	ee25xx_readStatus
  54              		.thumb
  55              		.thumb_func
  57              	ee25xx_readStatus:
  58              	.LFB1:
  20:uc_libc_dev/midia/spi_ee25xx.c **** }
  21:uc_libc_dev/midia/spi_ee25xx.c **** 
  22:uc_libc_dev/midia/spi_ee25xx.c **** u8 ee25xx_readStatus(void) {
  59              		.loc 1 22 0
  60              		.cfi_startproc
  61              		@ args = 0, pretend = 0, frame = 0
  62              		@ frame_needed = 0, uses_anonymous_args = 0
  23:uc_libc_dev/midia/spi_ee25xx.c **** 	u8 sts;
  24:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Enable();	
  63              		.loc 1 24 0
  64 0000 064B     		ldr	r3, .L5
  22:uc_libc_dev/midia/spi_ee25xx.c **** 	u8 sts;
  65              		.loc 1 22 0
  66 0002 10B5     		push	{r4, lr}
  67              	.LCFI0:
  68              		.cfi_def_cfa_offset 8
  69              		.cfi_offset 4, -8
  70              		.cfi_offset 14, -4
  71              		.loc 1 24 0
  72 0004 4024     		movs	r4, #64
  73 0006 1C60     		str	r4, [r3]
  25:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(EE25XX_CMD_RDSR);
  74              		.loc 1 25 0
  75 0008 0520     		movs	r0, #5
  76 000a FFF7FEFF 		bl	ssp1_TransferByte
  77              	.LVL0:
  26:uc_libc_dev/midia/spi_ee25xx.c **** 	sts = ee25xx_TransferByte(0);
  78              		.loc 1 26 0
  79 000e 0020     		movs	r0, #0
  80 0010 FFF7FEFF 		bl	ssp1_TransferByte
  81              	.LVL1:
  27:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Disable();
  82              		.loc 1 27 0
  83 0014 024B     		ldr	r3, .L5+4
  84 0016 1C60     		str	r4, [r3]
  28:uc_libc_dev/midia/spi_ee25xx.c **** 	return sts;
  29:uc_libc_dev/midia/spi_ee25xx.c **** }
  85              		.loc 1 29 0
  86 0018 10BD     		pop	{r4, pc}
  87              	.L6:
  88 001a 00BF     		.align	2
  89              	.L5:
  90 001c 1CC00920 		.word	537509916
  91 0020 18C00920 		.word	537509912
  92              		.cfi_endproc
  93              	.LFE1:
  95              		.section	.text.ee25xx_ReadBuffer,"ax",%progbits
  96              		.align	1
  97              		.global	ee25xx_ReadBuffer
  98              		.thumb
  99              		.thumb_func
 101              	ee25xx_ReadBuffer:
 102              	.LFB3:
  30:uc_libc_dev/midia/spi_ee25xx.c **** 
  31:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  32:uc_libc_dev/midia/spi_ee25xx.c **** // Descrição: 	Lê um byte da eeprom
  33:uc_libc_dev/midia/spi_ee25xx.c **** // parametros	Endereço para leitura
  34:uc_libc_dev/midia/spi_ee25xx.c **** // Retorna: 	Byte lido
  35:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  36:uc_libc_dev/midia/spi_ee25xx.c **** u8 ee25xx_ReadByte(u32 addr) {
  37:uc_libc_dev/midia/spi_ee25xx.c **** 	u8 dt;
  38:uc_libc_dev/midia/spi_ee25xx.c **** 	
  39:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_ReadBuffer(addr, &dt, 1);
  40:uc_libc_dev/midia/spi_ee25xx.c **** 	
  41:uc_libc_dev/midia/spi_ee25xx.c **** 	return dt;
  42:uc_libc_dev/midia/spi_ee25xx.c **** }
  43:uc_libc_dev/midia/spi_ee25xx.c **** 
  44:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  45:uc_libc_dev/midia/spi_ee25xx.c **** // Descrição: 	Lê um buffer da eeprom
  46:uc_libc_dev/midia/spi_ee25xx.c **** // parametros	parametro1: Endereço inicial para leitura
  47:uc_libc_dev/midia/spi_ee25xx.c **** //				parametro2: O ponteiro do buffer para retorno da leitura
  48:uc_libc_dev/midia/spi_ee25xx.c **** //				parametro3: O tamanho do buffer
  49:uc_libc_dev/midia/spi_ee25xx.c **** // Retorna: 	Nada
  50:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  51:uc_libc_dev/midia/spi_ee25xx.c **** void ee25xx_ReadBuffer(u32 addr, u8 *data, u32 nbytes) {
 103              		.loc 1 51 0
 104              		.cfi_startproc
 105              		@ args = 0, pretend = 0, frame = 0
 106              		@ frame_needed = 0, uses_anonymous_args = 0
 107              	.LVL2:
 108 0000 70B5     		push	{r4, r5, r6, lr}
 109              	.LCFI1:
 110              		.cfi_def_cfa_offset 16
 111              		.cfi_offset 4, -16
 112              		.cfi_offset 5, -12
 113              		.cfi_offset 6, -8
 114              		.cfi_offset 14, -4
 115              		.loc 1 51 0
 116 0002 0646     		mov	r6, r0
  52:uc_libc_dev/midia/spi_ee25xx.c **** 	// ENVIA O COMANDO DE LEITURA
  53:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Enable();
 117              		.loc 1 53 0
 118 0004 0D4B     		ldr	r3, .L12
  51:uc_libc_dev/midia/spi_ee25xx.c **** 	// ENVIA O COMANDO DE LEITURA
 119              		.loc 1 51 0
 120 0006 1546     		mov	r5, r2
 121              		.loc 1 53 0
 122 0008 4022     		movs	r2, #64
 123              	.LVL3:
 124 000a 1A60     		str	r2, [r3]
  54:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(EE25XX_CMD_READ);
 125              		.loc 1 54 0
 126 000c 0320     		movs	r0, #3
 127              	.LVL4:
  51:uc_libc_dev/midia/spi_ee25xx.c **** 	// ENVIA O COMANDO DE LEITURA
 128              		.loc 1 51 0
 129 000e 0C46     		mov	r4, r1
 130              		.loc 1 54 0
 131 0010 FFF7FEFF 		bl	ssp1_TransferByte
 132              	.LVL5:
  55:uc_libc_dev/midia/spi_ee25xx.c **** 	
  56:uc_libc_dev/midia/spi_ee25xx.c **** 	// ENVIA ENDEREÇO INICIAL
  57:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(addr>>8);
 133              		.loc 1 57 0
 134 0014 C6F30720 		ubfx	r0, r6, #8, #8
 135 0018 FFF7FEFF 		bl	ssp1_TransferByte
 136              	.LVL6:
  58:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(addr);
 137              		.loc 1 58 0
 138 001c F0B2     		uxtb	r0, r6
 139 001e FFF7FEFF 		bl	ssp1_TransferByte
 140              	.LVL7:
 141 0022 2544     		add	r5, r5, r4
 142              	.LVL8:
 143              	.L8:
  59:uc_libc_dev/midia/spi_ee25xx.c **** 		
  60:uc_libc_dev/midia/spi_ee25xx.c **** 	// CAPTURA OS DADOS
  61:uc_libc_dev/midia/spi_ee25xx.c **** 	while(nbytes--) {
 144              		.loc 1 61 0
 145 0024 AC42     		cmp	r4, r5
 146 0026 05D0     		beq	.L11
  62:uc_libc_dev/midia/spi_ee25xx.c **** 		 *data++ = ee25xx_TransferByte(0);
 147              		.loc 1 62 0
 148 0028 0020     		movs	r0, #0
 149 002a FFF7FEFF 		bl	ssp1_TransferByte
 150              	.LVL9:
 151 002e 04F8010B 		strb	r0, [r4], #1
 152              	.LVL10:
 153 0032 F7E7     		b	.L8
 154              	.LVL11:
 155              	.L11:
  63:uc_libc_dev/midia/spi_ee25xx.c **** 	}
  64:uc_libc_dev/midia/spi_ee25xx.c **** 	
  65:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Disable();
 156              		.loc 1 65 0
 157 0034 024B     		ldr	r3, .L12+4
 158 0036 4022     		movs	r2, #64
 159 0038 1A60     		str	r2, [r3]
 160 003a 70BD     		pop	{r4, r5, r6, pc}
 161              	.LVL12:
 162              	.L13:
 163              		.align	2
 164              	.L12:
 165 003c 1CC00920 		.word	537509916
 166 0040 18C00920 		.word	537509912
 167              		.cfi_endproc
 168              	.LFE3:
 170              		.section	.text.ee25xx_ReadByte,"ax",%progbits
 171              		.align	1
 172              		.global	ee25xx_ReadByte
 173              		.thumb
 174              		.thumb_func
 176              	ee25xx_ReadByte:
 177              	.LFB2:
  36:uc_libc_dev/midia/spi_ee25xx.c **** 	u8 dt;
 178              		.loc 1 36 0
 179              		.cfi_startproc
 180              		@ args = 0, pretend = 0, frame = 8
 181              		@ frame_needed = 0, uses_anonymous_args = 0
 182              	.LVL13:
 183 0000 07B5     		push	{r0, r1, r2, lr}
 184              	.LCFI2:
 185              		.cfi_def_cfa_offset 16
 186              		.cfi_offset 14, -4
  39:uc_libc_dev/midia/spi_ee25xx.c **** 	
 187              		.loc 1 39 0
 188 0002 0122     		movs	r2, #1
 189 0004 0DF10701 		add	r1, sp, #7
 190 0008 FFF7FEFF 		bl	ee25xx_ReadBuffer
 191              	.LVL14:
  42:uc_libc_dev/midia/spi_ee25xx.c **** 
 192              		.loc 1 42 0
 193 000c 9DF80700 		ldrb	r0, [sp, #7]	@ zero_extendqisi2
 194 0010 03B0     		add	sp, sp, #12
 195              	.LCFI3:
 196              		.cfi_def_cfa_offset 4
 197              		@ sp needed
 198 0012 5DF804FB 		ldr	pc, [sp], #4
 199              		.cfi_endproc
 200              	.LFE2:
 202              		.section	.text.ee25xx_WriteBuffer,"ax",%progbits
 203              		.align	1
 204              		.global	ee25xx_WriteBuffer
 205              		.thumb
 206              		.thumb_func
 208              	ee25xx_WriteBuffer:
 209              	.LFB5:
  66:uc_libc_dev/midia/spi_ee25xx.c **** }
  67:uc_libc_dev/midia/spi_ee25xx.c **** 
  68:uc_libc_dev/midia/spi_ee25xx.c **** 
  69:uc_libc_dev/midia/spi_ee25xx.c **** /*
  70:uc_libc_dev/midia/spi_ee25xx.c **** 
  71:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  72:uc_libc_dev/midia/spi_ee25xx.c **** // Descrição: 	Escreve um byte na eeprom
  73:uc_libc_dev/midia/spi_ee25xx.c **** // parametros	parametro1: Endereço inicial para escrita
  74:uc_libc_dev/midia/spi_ee25xx.c **** //				parametro2: O byte a ser escrito
  75:uc_libc_dev/midia/spi_ee25xx.c **** // Retorna: 	Nada
  76:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
  77:uc_libc_dev/midia/spi_ee25xx.c **** void ee25xx_WriteByte(u32 addr, u8 data) {
  78:uc_libc_dev/midia/spi_ee25xx.c **** 	// HABILITA A ESCRITA NO EEPROM. QUANDO ENVIAR O COMANDO DE LEITURA A ESCRITA É DESABILITADA AUTOM
  79:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Enable();
  80:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(EE25XX_CMD_WREN);
  81:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Disable();
  82:uc_libc_dev/midia/spi_ee25xx.c **** 
  83:uc_libc_dev/midia/spi_ee25xx.c **** 	// begin write
  84:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Enable();		
  85:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(EE25XX_CMD_WRITE);
  86:uc_libc_dev/midia/spi_ee25xx.c **** 
  87:uc_libc_dev/midia/spi_ee25xx.c **** 	// ENVIA O ENDEREÇO
  88:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(addr>>8);
  89:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(addr);
  90:uc_libc_dev/midia/spi_ee25xx.c **** 
  91:uc_libc_dev/midia/spi_ee25xx.c **** 	// ENVIA O DADO
  92:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_TransferByte(data);
  93:uc_libc_dev/midia/spi_ee25xx.c **** 	ee25xx_Disable();
  94:uc_libc_dev/midia/spi_ee25xx.c **** 	
  95:uc_libc_dev/midia/spi_ee25xx.c **** 	// ESPERA QUE A ESCRITA SEJA FINALIZADA
  96:uc_libc_dev/midia/spi_ee25xx.c **** 	while(ee25xx_readStatus() & EE25XX_STATUS_WIP);
  97:uc_libc_dev/midia/spi_ee25xx.c **** }
  98:uc_libc_dev/midia/spi_ee25xx.c **** 
  99:uc_libc_dev/midia/spi_ee25xx.c **** 
 100:uc_libc_dev/midia/spi_ee25xx.c **** // NÃO FAZ CONTROLE DO TAMANHO DA PÁGINA
 101:uc_libc_dev/midia/spi_ee25xx.c **** void ee25xx_WriteBuffer(u32 addr, u8 *data, u32 nbytes) {
 102:uc_libc_dev/midia/spi_ee25xx.c **** 	u8 xx;
 103:uc_libc_dev/midia/spi_ee25xx.c **** 	
 104:uc_libc_dev/midia/spi_ee25xx.c **** 	for (xx = 0; xx<nbytes;xx++) {
 105:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_WriteByte(addr++, *data++);
 106:uc_libc_dev/midia/spi_ee25xx.c **** 	}
 107:uc_libc_dev/midia/spi_ee25xx.c **** }
 108:uc_libc_dev/midia/spi_ee25xx.c **** */
 109:uc_libc_dev/midia/spi_ee25xx.c **** 
 110:uc_libc_dev/midia/spi_ee25xx.c **** 
 111:uc_libc_dev/midia/spi_ee25xx.c **** 
 112:uc_libc_dev/midia/spi_ee25xx.c **** void ee25xx_WriteByte(u32 addr, u8 data) {
 113:uc_libc_dev/midia/spi_ee25xx.c **** 	 ee25xx_WriteBuffer(addr, &data, 1);
 114:uc_libc_dev/midia/spi_ee25xx.c **** }
 115:uc_libc_dev/midia/spi_ee25xx.c **** 
 116:uc_libc_dev/midia/spi_ee25xx.c **** 
 117:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
 118:uc_libc_dev/midia/spi_ee25xx.c **** // Descrição: 	Escreve um buffer na eeprom
 119:uc_libc_dev/midia/spi_ee25xx.c **** // parametros	parametro1: Endereço inicial para escrita
 120:uc_libc_dev/midia/spi_ee25xx.c **** //				parametro2: O ponteiro do buffer dos dados a serem escritos
 121:uc_libc_dev/midia/spi_ee25xx.c **** //				parametro3: O tamanho do buffer
 122:uc_libc_dev/midia/spi_ee25xx.c **** // Retorna: 	Nada
 123:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
 124:uc_libc_dev/midia/spi_ee25xx.c **** // O procedimento de gravação na eeprom é diferente da leitura.
 125:uc_libc_dev/midia/spi_ee25xx.c **** // Na leitura podemos ler em burst preocupando somente no tamanho da memória,
 126:uc_libc_dev/midia/spi_ee25xx.c **** //		pois, apontamos o endereço inicial e acessamos os demais endereços automaticamente.
 127:uc_libc_dev/midia/spi_ee25xx.c **** // Porém, no processo de gravação na eeprom é feito por paginação, ou seja, quando vamos gravar um 
 128:uc_libc_dev/midia/spi_ee25xx.c **** // 		independente de sua quantidade desde que seja no limite da página da memória, o CI lê a página
 129:uc_libc_dev/midia/spi_ee25xx.c **** //		e nós atualizamos esse buffer com a gravação. No fim da gravação, quando o pino CS vai em alta,
 130:uc_libc_dev/midia/spi_ee25xx.c **** //		dados do buffer para a página.
 131:uc_libc_dev/midia/spi_ee25xx.c **** 
 132:uc_libc_dev/midia/spi_ee25xx.c **** // Para que a função de escrita tem o mesmo feito da leitura, teremos que ter o seguinte cuidado:
 133:uc_libc_dev/midia/spi_ee25xx.c **** // Em uma gravação em busrt, modo buffer, é preciso ter um cuidado com o incrementador de endereço 
 134:uc_libc_dev/midia/spi_ee25xx.c **** // 		pois, seu incremento é automático a cada gravação, também o endereçamento é circular apontando
 135:uc_libc_dev/midia/spi_ee25xx.c **** //			pelo fato da gravação ser por paginação.
 136:uc_libc_dev/midia/spi_ee25xx.c **** // Então, é preciso verificar se o endereço desejado de gravação ainda está dentro da página corren
 137:uc_libc_dev/midia/spi_ee25xx.c **** // Caso não esteja é preciso finalizar a gravação, mesmo que não fora enviados todos os dados do bu
 138:uc_libc_dev/midia/spi_ee25xx.c **** //		reiniciar uma nova gravação, com endereço atualizado, para continuar a gravar os demais dados d
 139:uc_libc_dev/midia/spi_ee25xx.c **** // 		Esse procedimento ativa a próxima página para gravação. 
 140:uc_libc_dev/midia/spi_ee25xx.c **** // Repetir esse processo até todos os dados do buffer sejam enviados para gravação.
 141:uc_libc_dev/midia/spi_ee25xx.c **** 
 142:uc_libc_dev/midia/spi_ee25xx.c **** void ee25xx_WriteBuffer(u32 addr, u8 *data, u32 nbytes) {
 210              		.loc 1 142 0
 211              		.cfi_startproc
 212              		@ args = 0, pretend = 0, frame = 0
 213              		@ frame_needed = 0, uses_anonymous_args = 0
 214              	.LVL15:
 215 0000 2DE9F84F 		push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
 216              	.LCFI4:
 217              		.cfi_def_cfa_offset 40
 218              		.cfi_offset 3, -40
 219              		.cfi_offset 4, -36
 220              		.cfi_offset 5, -32
 221              		.cfi_offset 6, -28
 222              		.cfi_offset 7, -24
 223              		.cfi_offset 8, -20
 224              		.cfi_offset 9, -16
 225              		.cfi_offset 10, -12
 226              		.cfi_offset 11, -8
 227              		.cfi_offset 14, -4
 143:uc_libc_dev/midia/spi_ee25xx.c **** 	u32 i;
 144:uc_libc_dev/midia/spi_ee25xx.c **** 	u32 qtdsave;
 145:uc_libc_dev/midia/spi_ee25xx.c **** 		
 146:uc_libc_dev/midia/spi_ee25xx.c **** 	#if (SPI_EEPROM_USE_DEBUG == pdON)
 147:uc_libc_dev/midia/spi_ee25xx.c **** 	u16 pagecount = 0;
 148:uc_libc_dev/midia/spi_ee25xx.c **** 	plog("EE: INIT WR BUF addr 0x%x size %d"CMD_TERMINATOR, addr, nbytes);
 149:uc_libc_dev/midia/spi_ee25xx.c **** 	#endif
 150:uc_libc_dev/midia/spi_ee25xx.c **** 	
 151:uc_libc_dev/midia/spi_ee25xx.c **** 	while (nbytes) {
 152:uc_libc_dev/midia/spi_ee25xx.c **** 		#if (SPI_EEPROM_USE_DEBUG == pdON)
 153:uc_libc_dev/midia/spi_ee25xx.c **** 		plog("EE: write buf pagecount %d addr 0x%x size %u"CMD_TERMINATOR, pagecount, addr, nbytes);
 154:uc_libc_dev/midia/spi_ee25xx.c **** 		pagecount++;
 155:uc_libc_dev/midia/spi_ee25xx.c **** 		#endif
 156:uc_libc_dev/midia/spi_ee25xx.c **** 
 157:uc_libc_dev/midia/spi_ee25xx.c **** 		// HABILITA ESCRITA NA EEPROM. ISTO SERÁ DESABILITADO AUTOMATICAMENTE QUANDO HOUVER UMA LEITURA
 158:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_Enable();
 159:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(EE25XX_CMD_WREN);
 160:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_Disable();
 228              		.loc 1 160 0
 229 0004 DFF87080 		ldr	r8, .L23+4
 142:uc_libc_dev/midia/spi_ee25xx.c **** 	u32 i;
 230              		.loc 1 142 0
 231 0008 0546     		mov	r5, r0
 232 000a 8B46     		mov	fp, r1
 233 000c 1646     		mov	r6, r2
 234 000e C146     		mov	r9, r8
 158:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(EE25XX_CMD_WREN);
 235              		.loc 1 158 0
 236 0010 184F     		ldr	r7, .L23
 237              	.LVL16:
 238              	.L16:
 151:uc_libc_dev/midia/spi_ee25xx.c **** 		#if (SPI_EEPROM_USE_DEBUG == pdON)
 239              		.loc 1 151 0
 240 0012 66B3     		cbz	r6, .L22
 158:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(EE25XX_CMD_WREN);
 241              		.loc 1 158 0
 242 0014 4024     		movs	r4, #64
 243 0016 3C60     		str	r4, [r7]
 159:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_Disable();
 244              		.loc 1 159 0
 245 0018 0620     		movs	r0, #6
 246 001a FFF7FEFF 		bl	ssp1_TransferByte
 247              	.LVL17:
 248              		.loc 1 160 0
 249 001e C8F80040 		str	r4, [r8]
 161:uc_libc_dev/midia/spi_ee25xx.c **** 
 162:uc_libc_dev/midia/spi_ee25xx.c **** 		// EMITE COMANDO DE ESCRITA
 163:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_Enable();
 164:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(EE25XX_CMD_WRITE);
 250              		.loc 1 164 0
 251 0022 0220     		movs	r0, #2
 163:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(EE25XX_CMD_WRITE);
 252              		.loc 1 163 0
 253 0024 3C60     		str	r4, [r7]
 254              		.loc 1 164 0
 255 0026 FFF7FEFF 		bl	ssp1_TransferByte
 256              	.LVL18:
 165:uc_libc_dev/midia/spi_ee25xx.c **** 
 166:uc_libc_dev/midia/spi_ee25xx.c **** 		// ENVIA ENDEREÇO INICIAL
 167:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(addr>>8);
 168:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(addr);
 169:uc_libc_dev/midia/spi_ee25xx.c **** 
 170:uc_libc_dev/midia/spi_ee25xx.c **** 		// DETERMINA A QUANTIDADE DE BYTES A SER GRAVADOS NA PÁGINA ATUAL DE ESCRITA
 171:uc_libc_dev/midia/spi_ee25xx.c **** 		qtdsave = EE25XX_PAGESIZE - addr % EE25XX_PAGESIZE; // Calcula a quantidade de bytes necessários 
 257              		.loc 1 171 0
 258 002a 05F01F04 		and	r4, r5, #31
 167:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_TransferByte(addr);
 259              		.loc 1 167 0
 260 002e C5F30720 		ubfx	r0, r5, #8, #8
 261 0032 FFF7FEFF 		bl	ssp1_TransferByte
 262              	.LVL19:
 263              		.loc 1 171 0
 264 0036 C4F12004 		rsb	r4, r4, #32
 168:uc_libc_dev/midia/spi_ee25xx.c **** 
 265              		.loc 1 168 0
 266 003a E8B2     		uxtb	r0, r5
 267 003c FFF7FEFF 		bl	ssp1_TransferByte
 268              	.LVL20:
 269 0040 B442     		cmp	r4, r6
 270 0042 28BF     		it	cs
 271 0044 3446     		movcs	r4, r6
 272              	.LVL21:
 273              		.loc 1 171 0
 274 0046 DA46     		mov	r10, fp
 275              	.LVL22:
 276              	.L17:
 172:uc_libc_dev/midia/spi_ee25xx.c **** 		if (qtdsave > nbytes) qtdsave = nbytes;				// Se a quantidade de bytes for maior a quantidade de 
 173:uc_libc_dev/midia/spi_ee25xx.c **** 
 174:uc_libc_dev/midia/spi_ee25xx.c **** 		#if (SPI_EEPROM_USE_DEBUG == pdON)
 175:uc_libc_dev/midia/spi_ee25xx.c **** 		plog("EE: qtdsave %u"CMD_TERMINATOR, qtdsave);
 176:uc_libc_dev/midia/spi_ee25xx.c **** 		#endif
 177:uc_libc_dev/midia/spi_ee25xx.c **** 
 178:uc_libc_dev/midia/spi_ee25xx.c **** 		// ENVIA OS DADOS PARA GRAVAÇÃO
 179:uc_libc_dev/midia/spi_ee25xx.c **** 		for(i=0; i<qtdsave; i++)
 180:uc_libc_dev/midia/spi_ee25xx.c **** 			ee25xx_TransferByte(*data++);
 277              		.loc 1 180 0 discriminator 3
 278 0048 1AF8010B 		ldrb	r0, [r10], #1	@ zero_extendqisi2
 279              	.LVL23:
 280 004c FFF7FEFF 		bl	ssp1_TransferByte
 281              	.LVL24:
 179:uc_libc_dev/midia/spi_ee25xx.c **** 			ee25xx_TransferByte(*data++);
 282              		.loc 1 179 0 discriminator 3
 283 0050 CBEB0A03 		rsb	r3, fp, r10
 284              	.LVL25:
 285 0054 A342     		cmp	r3, r4
 286 0056 F7D3     		bcc	.L17
 181:uc_libc_dev/midia/spi_ee25xx.c **** 		
 182:uc_libc_dev/midia/spi_ee25xx.c **** 		// CALCULA O ENDEREÇO INICIAL DA PRÓXIMA PAGINA DE GRAVAÇÃO E QUANTIDADE DE DADOS RESTANTES PARA 
 183:uc_libc_dev/midia/spi_ee25xx.c **** 		nbytes-=qtdsave;
 184:uc_libc_dev/midia/spi_ee25xx.c **** 		addr+=qtdsave;
 185:uc_libc_dev/midia/spi_ee25xx.c **** 		
 186:uc_libc_dev/midia/spi_ee25xx.c **** 		// FINALIZA E ESPERA ATÉ QUE O PROCESSO DE ESCRITA TERMINE
 187:uc_libc_dev/midia/spi_ee25xx.c **** 		ee25xx_Disable();
 287              		.loc 1 187 0
 288 0058 4023     		movs	r3, #64
 289              	.LVL26:
 183:uc_libc_dev/midia/spi_ee25xx.c **** 		addr+=qtdsave;
 290              		.loc 1 183 0
 291 005a 361B     		subs	r6, r6, r4
 292              	.LVL27:
 184:uc_libc_dev/midia/spi_ee25xx.c **** 		
 293              		.loc 1 184 0
 294 005c 2544     		add	r5, r5, r4
 295              	.LVL28:
 296              		.loc 1 187 0
 297 005e C9F80030 		str	r3, [r9]
 298              	.L18:
 188:uc_libc_dev/midia/spi_ee25xx.c **** 		while(ee25xx_readStatus() & EE25XX_STATUS_WIP);
 299              		.loc 1 188 0 discriminator 1
 300 0062 FFF7FEFF 		bl	ee25xx_readStatus
 301              	.LVL29:
 302 0066 C307     		lsls	r3, r0, #31
 303 0068 FBD4     		bmi	.L18
 180:uc_libc_dev/midia/spi_ee25xx.c **** 		
 304              		.loc 1 180 0
 305 006a D346     		mov	fp, r10
 306              	.LVL30:
 307 006c D1E7     		b	.L16
 308              	.LVL31:
 309              	.L22:
 189:uc_libc_dev/midia/spi_ee25xx.c **** 	}
 190:uc_libc_dev/midia/spi_ee25xx.c **** 	
 191:uc_libc_dev/midia/spi_ee25xx.c **** 	#if (SPI_EEPROM_USE_DEBUG == pdON)
 192:uc_libc_dev/midia/spi_ee25xx.c **** 	plog("EE: END"CMD_TERMINATOR);
 193:uc_libc_dev/midia/spi_ee25xx.c **** 	#endif
 194:uc_libc_dev/midia/spi_ee25xx.c **** }
 310              		.loc 1 194 0
 311 006e BDE8F88F 		pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
 312              	.LVL32:
 313              	.L24:
 314 0072 00BF     		.align	2
 315              	.L23:
 316 0074 1CC00920 		.word	537509916
 317 0078 18C00920 		.word	537509912
 318              		.cfi_endproc
 319              	.LFE5:
 321              		.section	.text.ee25xx_WriteByte,"ax",%progbits
 322              		.align	1
 323              		.global	ee25xx_WriteByte
 324              		.thumb
 325              		.thumb_func
 327              	ee25xx_WriteByte:
 328              	.LFB4:
 112:uc_libc_dev/midia/spi_ee25xx.c **** 	 ee25xx_WriteBuffer(addr, &data, 1);
 329              		.loc 1 112 0
 330              		.cfi_startproc
 331              		@ args = 0, pretend = 0, frame = 8
 332              		@ frame_needed = 0, uses_anonymous_args = 0
 333              	.LVL33:
 334 0000 07B5     		push	{r0, r1, r2, lr}
 335              	.LCFI5:
 336              		.cfi_def_cfa_offset 16
 337              		.cfi_offset 14, -4
 112:uc_libc_dev/midia/spi_ee25xx.c **** 	 ee25xx_WriteBuffer(addr, &data, 1);
 338              		.loc 1 112 0
 339 0002 02AB     		add	r3, sp, #8
 340 0004 03F8011D 		strb	r1, [r3, #-1]!
 113:uc_libc_dev/midia/spi_ee25xx.c **** }
 341              		.loc 1 113 0
 342 0008 0122     		movs	r2, #1
 343 000a 1946     		mov	r1, r3
 344              	.LVL34:
 345 000c FFF7FEFF 		bl	ee25xx_WriteBuffer
 346              	.LVL35:
 114:uc_libc_dev/midia/spi_ee25xx.c **** 
 347              		.loc 1 114 0
 348 0010 03B0     		add	sp, sp, #12
 349              	.LCFI6:
 350              		.cfi_def_cfa_offset 4
 351              		@ sp needed
 352 0012 5DF804FB 		ldr	pc, [sp], #4
 353              		.cfi_endproc
 354              	.LFE4:
 356              		.section	.text.ee25xx_dump,"ax",%progbits
 357              		.align	1
 358              		.global	ee25xx_dump
 359              		.thumb
 360              		.thumb_func
 362              	ee25xx_dump:
 363              	.LFB6:
 195:uc_libc_dev/midia/spi_ee25xx.c **** 
 196:uc_libc_dev/midia/spi_ee25xx.c **** #if (EE25XX_USE_DUMP == pdON)
 197:uc_libc_dev/midia/spi_ee25xx.c **** #include "utils.h"
 198:uc_libc_dev/midia/spi_ee25xx.c **** 
 199:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
 200:uc_libc_dev/midia/spi_ee25xx.c **** // Descrição: 	Exibe valores da eeprom no formato HEX ; ASCII em linhas com 16 bytes de dados
 201:uc_libc_dev/midia/spi_ee25xx.c **** // parametros	parametro1: Endereço inicial de leitura
 202:uc_libc_dev/midia/spi_ee25xx.c **** //				parametro2: Quantidade de dados a ser lido na eeprom
 203:uc_libc_dev/midia/spi_ee25xx.c **** // Retorna: 	Nada
 204:uc_libc_dev/midia/spi_ee25xx.c **** //-------------------------------------------------------------------------------------------------
 205:uc_libc_dev/midia/spi_ee25xx.c **** void ee25xx_dump(u32 addr, u32 qtd) {
 364              		.loc 1 205 0
 365              		.cfi_startproc
 366              		@ args = 0, pretend = 0, frame = 256
 367              		@ frame_needed = 0, uses_anonymous_args = 0
 368              	.LVL36:
 369 0000 2DE9F043 		push	{r4, r5, r6, r7, r8, r9, lr}
 370              	.LCFI7:
 371              		.cfi_def_cfa_offset 28
 372              		.cfi_offset 4, -28
 373              		.cfi_offset 5, -24
 374              		.cfi_offset 6, -20
 375              		.cfi_offset 7, -16
 376              		.cfi_offset 8, -12
 377              		.cfi_offset 9, -8
 378              		.cfi_offset 14, -4
 379 0004 0646     		mov	r6, r0
 380 0006 8846     		mov	r8, r1
 381 0008 C1B0     		sub	sp, sp, #260
 382              	.LCFI8:
 383              		.cfi_def_cfa_offset 288
 384              	.LVL37:
 385              	.L27:
 206:uc_libc_dev/midia/spi_ee25xx.c **** 	u16 qtd_rd;
 207:uc_libc_dev/midia/spi_ee25xx.c **** 	u8 buffer[256];
 208:uc_libc_dev/midia/spi_ee25xx.c **** 	u8 *ptr;
 209:uc_libc_dev/midia/spi_ee25xx.c **** 
 210:uc_libc_dev/midia/spi_ee25xx.c **** 	while (qtd) {
 386              		.loc 1 210 0
 387 000a B8F1000F 		cmp	r8, #0
 388 000e 33D0     		beq	.L39
 211:uc_libc_dev/midia/spi_ee25xx.c ****   		if (qtd > sizeof(buffer)) 
 389              		.loc 1 211 0
 390 0010 B8F5807F 		cmp	r8, #256
 212:uc_libc_dev/midia/spi_ee25xx.c ****   				qtd_rd = sizeof(buffer);
 213:uc_libc_dev/midia/spi_ee25xx.c ****   		else	qtd_rd = qtd;
 391              		.loc 1 213 0
 392 0014 94BF     		ite	ls
 393 0016 1FFA88F5 		uxthls	r5, r8
 394              	.LVL38:
 212:uc_libc_dev/midia/spi_ee25xx.c ****   				qtd_rd = sizeof(buffer);
 395              		.loc 1 212 0
 396 001a 4FF48075 		movhi	r5, #256
 397              	.LVL39:
 214:uc_libc_dev/midia/spi_ee25xx.c ****   			
 215:uc_libc_dev/midia/spi_ee25xx.c ****   		ee25xx_ReadBuffer(addr, buffer, qtd_rd);
 398              		.loc 1 215 0
 399 001e 2A46     		mov	r2, r5
 400 0020 6946     		mov	r1, sp
 401 0022 3046     		mov	r0, r6
 402 0024 FFF7FEFF 		bl	ee25xx_ReadBuffer
 403              	.LVL40:
 216:uc_libc_dev/midia/spi_ee25xx.c ****   		qtd-=qtd_rd;
 217:uc_libc_dev/midia/spi_ee25xx.c ****   		ptr=buffer;
 218:uc_libc_dev/midia/spi_ee25xx.c ****   		  		
 219:uc_libc_dev/midia/spi_ee25xx.c ****   		if (qtd_rd >= 16)
 404              		.loc 1 219 0
 405 0028 0F2D     		cmp	r5, #15
 216:uc_libc_dev/midia/spi_ee25xx.c ****   		qtd-=qtd_rd;
 406              		.loc 1 216 0
 407 002a C5EB0808 		rsb	r8, r5, r8
 408              	.LVL41:
 409              		.loc 1 219 0
 410 002e 1AD9     		bls	.L34
 411 0030 3746     		mov	r7, r6
 412 0032 A5F11004 		sub	r4, r5, #16
 413 0036 C4F30B14 		ubfx	r4, r4, #4, #12
 414 003a 06F11009 		add	r9, r6, #16
 415 003e 09EB0419 		add	r9, r9, r4, lsl #4
 416              	.LVL42:
 417              	.L30:
 220:uc_libc_dev/midia/spi_ee25xx.c ****   			// Enquanto o qtd_rd for maior que 15 faz, depois incrementea addr do buffer e da eeprom por 1
 221:uc_libc_dev/midia/spi_ee25xx.c ****   			for( ; qtd_rd>=16; ptr+=16, addr+=16, qtd_rd-=16 ) 
 222:uc_libc_dev/midia/spi_ee25xx.c ****   				put_dump16(ptr, addr, 16, 16);
 418              		.loc 1 222 0 discriminator 2
 419 0042 B81B     		subs	r0, r7, r6
 420 0044 1023     		movs	r3, #16
 421 0046 3946     		mov	r1, r7
 422 0048 1A46     		mov	r2, r3
 423 004a 6844     		add	r0, r0, sp
 221:uc_libc_dev/midia/spi_ee25xx.c ****   				put_dump16(ptr, addr, 16, 16);
 424              		.loc 1 221 0 discriminator 2
 425 004c 1037     		adds	r7, r7, #16
 426              	.LVL43:
 427              		.loc 1 222 0 discriminator 2
 428 004e FFF7FEFF 		bl	put_dump16
 429              	.LVL44:
 221:uc_libc_dev/midia/spi_ee25xx.c ****   				put_dump16(ptr, addr, 16, 16);
 430              		.loc 1 221 0 discriminator 2
 431 0052 4F45     		cmp	r7, r9
 432 0054 F5D1     		bne	.L30
 433 0056 601C     		adds	r0, r4, #1
 223:uc_libc_dev/midia/spi_ee25xx.c ****   			
 224:uc_libc_dev/midia/spi_ee25xx.c **** 		if (qtd_rd)
 434              		.loc 1 224 0
 435 0058 15F00F05 		ands	r5, r5, #15
 436 005c 0DEB0010 		add	r0, sp, r0, lsl #4
 437              	.LVL45:
 438 0060 08D0     		beq	.L31
 439 0062 3E46     		mov	r6, r7
 440 0064 00E0     		b	.L29
 441              	.LVL46:
 442              	.L34:
 217:uc_libc_dev/midia/spi_ee25xx.c ****   		  		
 443              		.loc 1 217 0
 444 0066 6846     		mov	r0, sp
 445              	.LVL47:
 446              	.L29:
 225:uc_libc_dev/midia/spi_ee25xx.c **** 			put_dump16(ptr, addr, qtd_rd, 16);
 447              		.loc 1 225 0
 448 0068 1023     		movs	r3, #16
 449 006a 2A46     		mov	r2, r5
 450 006c 3146     		mov	r1, r6
 451 006e FFF7FEFF 		bl	put_dump16
 452              	.LVL48:
 453 0072 B146     		mov	r9, r6
 454              	.LVL49:
 455              	.L31:
 456 0074 4E46     		mov	r6, r9
 457 0076 C8E7     		b	.L27
 458              	.LVL50:
 459              	.L39:
 226:uc_libc_dev/midia/spi_ee25xx.c ****   	}
 227:uc_libc_dev/midia/spi_ee25xx.c **** }
 460              		.loc 1 227 0
 461 0078 41B0     		add	sp, sp, #260
 462              	.LCFI9:
 463              		.cfi_def_cfa_offset 28
 464              		@ sp needed
 465 007a BDE8F083 		pop	{r4, r5, r6, r7, r8, r9, pc}
 466              		.cfi_endproc
 467              	.LFE6:
 469              		.text
 470              	.Letext0:
 471              		.file 2 "uc_libc_dev/_libdef/uc_libdefs.h"
 472              		.file 3 "uc_libc_dev/_arch/arm_lpc/spi/ssp1.h"
 473              		.file 4 "uc_libc_dev/misc/utils.h"
DEFINED SYMBOLS
                            *ABS*:00000000 spi_ee25xx.c
D:\_temp\_windows\cc7DrqRt.s:20     .text.ee25xx_Init:00000000 $t
D:\_temp\_windows\cc7DrqRt.s:25     .text.ee25xx_Init:00000000 ee25xx_Init
D:\_temp\_windows\cc7DrqRt.s:46     .text.ee25xx_Init:00000014 $d
D:\_temp\_windows\cc7DrqRt.s:52     .text.ee25xx_readStatus:00000000 $t
D:\_temp\_windows\cc7DrqRt.s:57     .text.ee25xx_readStatus:00000000 ee25xx_readStatus
D:\_temp\_windows\cc7DrqRt.s:90     .text.ee25xx_readStatus:0000001c $d
D:\_temp\_windows\cc7DrqRt.s:96     .text.ee25xx_ReadBuffer:00000000 $t
D:\_temp\_windows\cc7DrqRt.s:101    .text.ee25xx_ReadBuffer:00000000 ee25xx_ReadBuffer
D:\_temp\_windows\cc7DrqRt.s:165    .text.ee25xx_ReadBuffer:0000003c $d
D:\_temp\_windows\cc7DrqRt.s:171    .text.ee25xx_ReadByte:00000000 $t
D:\_temp\_windows\cc7DrqRt.s:176    .text.ee25xx_ReadByte:00000000 ee25xx_ReadByte
D:\_temp\_windows\cc7DrqRt.s:203    .text.ee25xx_WriteBuffer:00000000 $t
D:\_temp\_windows\cc7DrqRt.s:208    .text.ee25xx_WriteBuffer:00000000 ee25xx_WriteBuffer
D:\_temp\_windows\cc7DrqRt.s:316    .text.ee25xx_WriteBuffer:00000074 $d
D:\_temp\_windows\cc7DrqRt.s:322    .text.ee25xx_WriteByte:00000000 $t
D:\_temp\_windows\cc7DrqRt.s:327    .text.ee25xx_WriteByte:00000000 ee25xx_WriteByte
D:\_temp\_windows\cc7DrqRt.s:357    .text.ee25xx_dump:00000000 $t
D:\_temp\_windows\cc7DrqRt.s:362    .text.ee25xx_dump:00000000 ee25xx_dump
                     .debug_frame:00000010 $d

UNDEFINED SYMBOLS
ssp1_TransferByte
put_dump16
